package com.pentalog.fullsix.bean.frontend;

import java.util.Locale;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

import com.pentalog.fullsix.bean.BaseBean;

@ManagedBean(name = "homeBean")
@SessionScoped
public class HomeBean extends BaseBean {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String locale = "vi";

	public void setLocale(String locale) {
		this.locale = locale;
	}

	public HomeBean() {
		super();
		FacesContext.getCurrentInstance().getViewRoot()
				.setLocale(new Locale("vi"));
		// TODO Auto-generated constructor stub
	}

	public synchronized String getLocale() {
		return locale;
	}

	public void changeLang(String langCode) {
		FacesContext.getCurrentInstance().getViewRoot()
				.setLocale(new Locale(langCode));
		this.locale = langCode;
	}
}
